import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class StudentData <T>{
    private static  List<Student> stuData;
    public static int num;

    public static void set(int x){
        Scanner sc=new Scanner(System.in);
        stuData=new ArrayList<Student>(10);
        for (int i = 0; i < x; i++) {
            System.out.println("输入学号：");
            String a=sc.nextLine();
            System.out.println("输入姓名:");
            String b=sc.nextLine();
            System.out.println("输入性别:");
            String c=sc.nextLine();
            System.out.println("输入年龄");
            int d=sc.nextInt();
            sc.nextLine();
            stuData.add(new Student(a,b,c,d));
            num++;
        }
    }

    public static List<Student> getStuData(){
        return StudentData.stuData;
    }
    public static  Student getStudent(int x){
        if(x<num){
            return stuData.get(x);
        }else{
            return null;
        }
    }
    public static void stuDataSet(List<Student>stu1){
        if(stu1==null){
            return;
        }
        stuData=stu1;
    }

    public static void stuSet(Student stu1,int i){
        if(stu1==null){
            return;
        }

        stuData.set(i,stu1);
    }

    public static void stuDelete(Student stu){
        stuData.remove(stu);
    }

    public static void stuAdd(Student stu){
        stuData.add(stu);
    }
}
